home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 February
/
PCWorld_2007-02_cd.bin
/
v cisle
/
Addons
/
Addons.exe
/
videodownloader-1.1.1-fx.xpi
/
chrome
/
videodownloader.jar
/
content
/
overlay.js
< prev
next >
Wrap
Text File
|
2006-08-24
|
3KB
|
84 lines
/*
* Version: Open Software License v. 2.1
*
* The contents of this file are subject to the Open Software License Version
* 2.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.opensource.org/licenses/osl-2.1.php
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the VideoDownloader.
*
* The Initial Developer of the Original Code is
* Javi Moya
*
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* */
var instanteGlobal=0;
function clickButton(e) {
if (e.button == 0)
{
var currentTime = new Date();
var instante = currentTime.getTime();
var dir = window.content.document.location.href;
if (((instanteGlobal==0) || (instanteGlobal<(instante-10000))) && (dir.indexOf('javimoya.com/blog/youtube')==-1) && (dir.indexOf('videodownloader.net')==-1))
{
instanteGlobal=instante;
var txt = "http://videodownloader.net/get/?url=" + escape(dir) + "&orig=ffp&ver=1.1";
window.open(txt,'VD','fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=400');
}
}
if (e.button == 2)
{
openPrefDialog();
}
e.preventDefault();
}
function openPrefDialog() {
/*var icon = document.getElementById('videodownloader-statusbar-panel');*/
window.openDialog('chrome://videodownloader/content/options.xul',
'VideoDownloader Preferences',
'chrome,centerscreen,dependent');
}
function getBoolPref(prefName, defval) {
var result = defval;
var prefservice = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
var prefs = prefservice.getBranch("");
if (prefs.getPrefType(prefName) == prefs.PREF_BOOL)
{
result = prefs.getBoolPref(prefName);
}
return(result);
}
window.addEventListener("load", videodownloaderInitListener, false);
function videodownloaderInitListener(e) {
var showicon = getBoolPref("extensions.videodownloader.boolpref", true);
var icon = document.getElementById('videodownloader-statusbar-panel');
if (icon && showicon)
{
icon.removeAttribute("hidden");
}
else
{
icon.setAttribute("hidden", true);
}
}